import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { from } from 'rxjs';

// 新增自定义路由

import { HomeComponent } from './home/home.component'

// import { HomepageComponent }  from './homepage/homepage.component';
// import { HeroesComponent }      from './heroes/heroes.component';
// import { DashboardComponent }   from './dashboard/dashboard.component';
// import { HeroDetailComponent }  from './hero-detail/hero-detail.component';
// import { TestPrimeComponent }  from './test-prime/test-prime.component';

const routes: Routes = [
  
  { path: '', redirectTo: '/home', pathMatch: 'full' },// 默认路由
  { path: 'home', component: HomeComponent },  // 首页 

  // { path: 'homepage', component: HomepageComponent },  // 首页
  // { path: 'heroes', component: HeroesComponent },
  // { path: 'dashboard', component: DashboardComponent },
  // { path: 'detail/:id', component: HeroDetailComponent },
  // { path: 'test-prime', component: TestPrimeComponent },  
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [ RouterModule ],
  declarations: []
})
export class AppRoutingModule { }